package com.example.mytest;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends Activity {

	private Button loginButton;
	private EditText username;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        username = (EditText)findViewById(R.id.username_input);
        loginButton = (Button)findViewById(R.id.login_button);
        loginButton.setText("Login");
        loginButton.setOnClickListener(new loginButtonListener());
    }

    class loginButtonListener implements OnClickListener {
    	
    	public void onClick(View v) {
    		 Intent intent = new Intent(); 
             
    		 Bundle bundle = new Bundle();
    		 
    		 bundle.putString("username", username.getText().toString());
    		 
    		 intent.putExtras(bundle);
             
    		 intent.setClass(MainActivity.this, mainMenu.class);
             startActivity(intent);
    	 }
    }
    
}
